package com.superpeer.baseproject.activity;

import android.util.Log;

import com.superpeer.baseproject.api.RxSubscriber;
import com.superpeer.baseproject.bean.BaseBeanResult;

public class MainPresenter extends MainContract.Presenter {

    @Override
    public void getNews(int defaultCurrent, int pageSize) {
//        mRxManage.add(mModel.getNews(defaultCurrent,pageSize).subscribe(new RxSubscriber<BaseBeanResult>(mContext ,true) {
//            @Override
//            protected void _onNext(BaseBeanResult baseBeanResult) {
//                mView.showGetNews(baseBeanResult);
//            }
//
//            @Override
//            protected void _onError(String message) {
//                mView.showErrorTip(message);
//            }
//        }));
        mModel.getNews(defaultCurrent,pageSize).subscribe(new RxSubscriber<BaseBeanResult>(mContext ,true) {
            @Override
            protected void _onNext(BaseBeanResult baseBeanResult) {
                mView.showGetNews(baseBeanResult);
            }

            @Override
            protected void _onError(String message) {
                mView.showErrorTip(message);
            }
        });
    }
}
